package commands;

import java.util.HashMap;

public class CCommandLoader extends HashMap<String, ICommand> {
	private static final long serialVersionUID = 2827704397405342383L;
	private CCommandHandler handler;

	public CCommandLoader(CCommandHandler h) {
		super();
		handler = h;
		putCommand(new Commandhome(handler));
		putCommand(new Commandsethome(handler));
	}
	
	private void putCommand(ICommand cmd)
	{
		put(cmd.getCommandName(), cmd);
	}

	public ICommand getCommandByName(String name) {
		return this.get(name);
		
	}

}
